#ifndef __APP_MSG_H
#define __APP_MSG_H
#include "app_common.h"

typedef struct
{
    char *connType;
    int motorId;
    char *action;
    int16_t motorSpeed;
    char *status;
} msg_t;

gate_status_t app_msg_json_2_msg(char *json, msg_t *msg);  // 2 -> two -> to
gate_status_t app_msg_msg_2_json(msg_t *msg, char *json);
#endif

/*
发送给motor的数据:
    {
        "connType": "rs485",
        "motorId": 8,
        "action": "get"
    }

    {
        "connType": "rs485",
        "motorId": 8,
        "action": "set",
        "motorSpeed": 300
    }

发送给给mqtt服务器的数据:
    {
        "connType": "rs485",
        "motorId": 8,
        "action": "get",
        "motorSpeed": 300,
        "status": "ok"
    }
*/
